import Xsync from '@/utils/Xsync';
import { portPrefixPublic } from '@/config';

// 添加
export const addValue = (tableName, params) =>
    Xsync({
        method: 'POST',
        url: `${portPrefixPublic}/add/${tableName}`,
        params
    });

// 删除
export const deleteByIds = (tableName, params) =>
    Xsync({
        method: 'POST',
        url: `${portPrefixPublic}/deleteMany/${tableName}`,
        params
    });

// 查询
export const queryDetails = (tableName, params) =>
    Xsync({
        method: 'POST',
        url: `${portPrefixPublic}/query/${tableName}`,
        params
    });
// 查询
export const queryValue = (tableName, params) =>
    Xsync({
        method: 'POST',
        url: `${portPrefixPublic}/queryMany/${tableName}`,
        params
    });

// 更新
export const updateValue = (tableName, params) =>
    Xsync({
        method: 'POST',
        url: `${portPrefixPublic}/update/${tableName}`,
        params
    });
